import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import User from '../views/User.vue'
import PersonCenter from '../views/Person.vue'
import Login from '../views/Login.vue'
//帖子
import PostQuery from '../views/post/PostQuery.vue'
import PostDetail from '../views/post/PostDetail.vue'
//报表
import ReportExport from '../views/report/ReportExport.vue'
//消息、聊天室
import MessageList from '../views/message/MessageList.vue'
import MessageChatRoom from '../views/message/MessageChatRoom.vue'
//AI
import DeepSeek from '../views/ai/DeepSeek.vue'
//审批
import ApproveDetail from '../views/approve/ApproveDetail.vue'
import ApproveList from '../views/approve/ApproveList.vue'
//产品
import ProductList from '../views/product/ProductList.vue'
//积分
import PointsRank from '../views/points/PointsRank.vue'
import PointsDetail from '../views/points/PointsDetail.vue'
import PointsChannelList from '../views/points/PointsChannelList.vue'
//角色管理
import RoleMgrRole from '../views/roleMgr/RoleMgrRole'
import RoleMgrUser from '../views/roleMgr/RoleMgrUser'
import RoleMgrGroup from '../views/roleMgr/RoleMgrGroup'
import RoleMgrResource from '../views/roleMgr/RoleMgrResource'
//测试页面
import TestView from '../views/test/TestView.vue'

import Main from '../views/Main.vue'

Vue.use(VueRouter)

const routes = [
    // 主路由
    {
        path: '/',
        component: Main,
        redirect: '/home', //重定向
        children: [
            // 子路由
            { path: 'home', name: 'home', component: Home }, // 首页
            { path: 'user', name: 'user', component: User }, // 用户管理
            { path: 'personCenter', name: 'personCenter', component: PersonCenter }, // 个人中心
            { path: 'post/query', name: 'postQuery', component: PostQuery }, // 帖子查询
            { path: 'post/detail', name: 'postDetail', component: PostDetail }, // 帖子详情
            { path: 'report/export', name: 'reportExport', component: ReportExport }, // 报表导出列表
            { path: 'message/list', name: 'messageList', component: MessageList }, // 消息列表
            { path: 'message/chatRoom', name: 'messageChatRoom', component: MessageChatRoom }, // 消息-聊天室
            { path: 'ai/deepseek', name: 'deepseek', component: DeepSeek }, // AI-deepseek
            { path: 'approve/approveList', name: 'approveList', component: ApproveList }, // 审批列表
            { path: 'approve/approveDetail', name: 'approveDetail', component: ApproveDetail }, // 审批链详情
            { path: 'product/productList', name: 'productList', component: ProductList }, // 产品列表
            { path: 'points/pointsRank', name: 'pointsRank', component: PointsRank }, // 积分排行
            { path: 'points/pointsDetail', name: 'pointsDetail', component: PointsDetail }, // 积分明细
            { path: 'points/pointsChannelList', name: 'pointsChannelList', component: PointsChannelList }, // 积分明细
            { path: 'roleMgr/role', name: 'roleMgrRole', component: RoleMgrRole }, // 角色管理
            { path: 'roleMgr/user', name: 'roleMgrUser', component: RoleMgrUser }, // 用户管理
            { path: 'roleMgr/group', name: 'roleMgrGroup', component: RoleMgrGroup }, // 权限组管理
            { path: 'roleMgr/resource', name: 'roleMgrResource', component: RoleMgrResource }, // 接口权限管理
            { path: 'test/testView', name: 'testView', component: TestView }, // 测试页面
        ]
    },
    {
        path: '/login',
        name: 'login', // 登录页
        component: Login
    }
    
]

const router = new VueRouter({
    routes // (缩写) 相当于 routes: routes
})

export default router